home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / science / chemlab.sit / Chem Inventory 2.2 / stack_-1.xml < prev   
Encoding:
Extensible Markup Language  |  1991-09-22  |  7.1 KB  |  43 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in.2</name>
  5.     <id>-1</id>
  6.     <cardCount>23</cardCount>
  7.     <cardID>39297</cardID>
  8.     <listID>10491</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>
  17. on OpenStack
  18. set numberFormat to "0.#"
  19. global holdlevel
  20. get userlevel
  21. put It into holdlevel
  22. set userlevel to 3
  23. get the freesize of this stack
  24. if it <> 0 then domenu "Compact Stack"
  25. get the size of this stack
  26. put it into Big1
  27. divide Big1 by 1024
  28. put Big1 into field 2 of card id 39297
  29. get field 6 of card id 39297
  30. if it is empty then ask "Please type in your full name:"
  31. put it into field 6 of card id 39297
  32. get field 6 of card id 39297
  33. if it is empty then domenu "Quit Hypercard"
  34. create menu "Utilities"
  35. put "Import,Export,Merge,-,Scan" into menu "Utilities" with menuMsg "Import,Export,,,Look"
  36. put "First,Prev,Next,Last,-,Find...,Message" into menu "Go"
  37. put "1,2,3,4,,F,M" into fileMenCmd1
  38. repeat with x = 1 to number of items of fileMenCmd1
  39. set commandChar of MenuItem x of menu "Go" to item x of fileMenCmd1
  40. end repeat
  41. put "Cut,Copy,Paste Text,-,New Card" into menu "Edit"
  42. put "X,C,V,,N" into fileMenCmd2
  43. repeat with x = 1 to number of items of fileMenCmd2
  44. set commandChar of MenuItem x of menu "Edit" to item x of fileMenCmd2
  45. end repeat
  46. put "Open Stack...,Save a Copy...,-,Compact Stack,Protect Stack...,-,Page Setup...,Print Card,Print Report...,Quit" into menu "File"
  47. put "O,,,,,,,P,,Q" into fileMenCmd3
  48. repeat with x = 1 to number of items of fileMenCmd3
  49. set commandChar of MenuItem x of menu "File" to item x of fileMenCmd3
  50. end repeat
  51. set menuMsg of  MenuItem 10 of menu "File" to "Quit"
  52. create menu "Sort by"
  53. put "Name,Formula,Where it is,Date acquired,CAS #,Hazard" into menu "Sort by" with menuMsg "Shuffle,DS1,DS2,DS3,DS4,DS5"
  54. delete menu "Font"
  55. delete menu "Style"
  56. delete menu "Tools"
  57. put "About Chem Inventory..." into menuItem 1 of menu 1 with menuMsg Dan
  58.  
  59. end OpenStack
  60.  
  61. on Dan
  62. show card field "About" of card id 39297
  63. show card button id 9 of card id 39297
  64. show card button id 10 of card id 39297
  65. end Dan
  66.  
  67. on Look
  68. show all cards
  69. end Look
  70.  
  71. on Import
  72. ask "File to import text from?"
  73. if it is empty then exit Import
  74. put it into readFrom
  75. open file readFrom
  76. repeat forever
  77. doMenu "Last"
  78. doMenu "New Card"
  79. repeat with fieldCount=1 to the number of fields
  80. read from file readFrom until tab
  81. if it is empty then --end of file reached
  82. if fieldCount=1 then doMenu "Delete Card"
  83. close file readFrom
  84. exit Import
  85. end if
  86. put it into field fieldCount
  87. end repeat
  88. end repeat
  89. end Import
  90.  
  91. on Export
  92. ask "Name of file to write to?"
  93. if it is empty then exit Export
  94. put it into writeTo
  95. open file writeTo
  96. go to second card
  97. repeat for number of cards
  98. repeat with fieldCount=1 to the number of fields
  99. write field fieldCount to file writeTo
  100. write tab to file writeTo
  101. end repeat
  102. go to next card
  103. end repeat
  104. close file writeTo
  105. end Export
  106.  
  107. on Shuffle
  108. --This code is copyright 1991 by Dr. Dan Swartling
  109. --Unauthorized use  will be procecuted to the fullest extent
  110. --of the law.
  111. answer "Sort all cards of this stack according to:" ┬¼
  112. with "Cmpnd Name" or "Cancel"
  113. if it is "Cmpnd Name" then
  114. set lockscreen to true
  115. set lockrecent to true
  116. repeat for number of cards
  117. advanceCursor
  118. repeat with Pt=1 to the length of background field "Compound Name"
  119. advanceCursor
  120. put character Pt of background field "Compound Name" into tempChar
  121. put the charToNum of tempChar into Code
  122. if Code is 44 then
  123. subtract 8 from Code
  124. put the numToChar of Code into tempChar
  125. put tempChar into character Pt of background field "Compound Name"
  126. end if
  127. if (Code >=65) and (Code<=90) then
  128. put "," before character pt of background field "Compound Name"
  129. exit repeat
  130. end if
  131. advanceCursor
  132. end repeat
  133. go to next card
  134. end repeat
  135.  
  136. sort by second item of field "Compound Name"
  137.  
  138. repeat for number of cards
  139. repeat with Pt=1 to the length of background field "Compound Name"
  140. advanceCursor
  141. put character Pt of background field "Compound Name" into tempChar
  142. put the charToNum of tempChar into Code
  143. if Code = 44 then
  144. delete character pt of background field "Compound Name"
  145. advanceCursor
  146. exit repeat
  147. end if
  148. if Code is 36 then
  149. add 8 to Code
  150. put the numToChar of Code into tempChar
  151. put tempChar into character Pt of background┬¼
  152. field "Compound Name"
  153. end if
  154. end repeat
  155. go to next card
  156. end repeat
  157. advanceCursor
  158. set lockscreen to false
  159. set lockrecent to false
  160.  
  161. else if it is "Cancel" then
  162. exit Shuffle
  163. end if
  164. end Shuffle
  165.  
  166. on DS1
  167. sort by background field "Formula"
  168. end DS1
  169.  
  170. on DS2
  171. sort by background field "Where is it"
  172. end DS2
  173.  
  174. on DS3
  175. sort by background field "DateAcquired"
  176. end DS3
  177.  
  178. on DS4
  179. sort by background field "CAS#"
  180. end DS4
  181.  
  182. on DS5
  183. sort by background field "Hazard"
  184. end DS5
  185.  
  186. on AnimCurs CursType, MaxCount
  187. global AnimCursNumber
  188. add 1 to AnimCursNumber
  189. set the cursor to CursType & AnimCursNumber
  190. if AnimCursNumber > MaxCount then put 1 into AnimCursNumber
  191. end AnimCurs
  192. on advanceCursor
  193. global cursCount
  194. wait 1 tick
  195. set cursor to "Earth" & cursCount
  196. if cursCount > 6
  197. then put 1 into cursCount
  198. else add 1 to cursCount
  199. end advanceCursor
  200.  
  201. on Quit
  202. flash three, times
  203. domenu "Quit HyperCard"
  204. end Quit
  205.  
  206. on CloseStack
  207. global holdlevel
  208. set userlevel to 5
  209. reset menubar
  210. end CloseStack
  211. </script>
  212.     <background id="4909" file="background_4909.xml" name="" />
  213.     <background id="38941" file="background_38941.xml" name="" />
  214.     <card id="39297" file="card_39297.xml" marked="false" name="Summary" owner="38941" />
  215.     <card id="9073" file="card_9073.xml" marked="false" name="" owner="4909" />
  216.     <card id="9305" file="card_9305.xml" marked="false" name="" owner="4909" />
  217.     <card id="4732" file="card_4732.xml" marked="false" name="" owner="4909" />
  218.     <card id="2585" file="card_2585.xml" marked="false" name="" owner="4909" />
  219.     <card id="2336" file="card_2336.xml" marked="false" name="" owner="4909" />
  220.     <card id="2849" file="card_2849.xml" marked="false" name="" owner="4909" />
  221.     <card id="9500" file="card_9500.xml" marked="false" name="" owner="4909" />
  222.     <card id="6055" file="card_6055.xml" marked="false" name="" owner="4909" />
  223.     <card id="3091" file="card_3091.xml" marked="false" name="" owner="4909" />
  224.     <card id="5859" file="card_5859.xml" marked="false" name="" owner="4909" />
  225.     <card id="3955" file="card_3955.xml" marked="false" name="" owner="4909" />
  226.     <card id="3654" file="card_3654.xml" marked="false" name="" owner="4909" />
  227.     <card id="7830" file="card_7830.xml" marked="false" name="" owner="4909" />
  228.     <card id="5553" file="card_5553.xml" marked="false" name="" owner="4909" />
  229.     <card id="4112" file="card_4112.xml" marked="false" name="" owner="4909" />
  230.     <card id="10606" file="card_10606.xml" marked="false" name="Base card" owner="4909" />
  231.     <card id="9916" file="card_9916.xml" marked="false" name="" owner="4909" />
  232.     <card id="4509" file="card_4509.xml" marked="false" name="" owner="4909" />
  233.     <card id="7953" file="card_7953.xml" marked="false" name="" owner="4909" />
  234.     <card id="7124" file="card_7124.xml" marked="false" name="" owner="4909" />
  235.     <card id="8477" file="card_8477.xml" marked="false" name="" owner="4909" />
  236.     <card id="8779" file="card_8779.xml" marked="false" name="" owner="4909" />
  237. </stack>
  238.